const iconss: string[] = [];
const modules = import.meta.glob('../../../assets/images/cmdb/*.svg');
for (const path in modules) {
  console.log(path);

  const p = path.split('assets/images/cmdb/')[1].split('.svg')[0];
  iconss.push(p);
}
export const icons = iconss;



/* 唯一标识正则校验 */
export const keyRules = (rule: any, value: any, callback: any) => {
  
  console.log(value);
  
  const regex = /^[a-zA-Z0-9_]+$/;  

  console.log(regex.test(value));
  
  if (!value) {
    callback(new Error('请输入唯一标识'));
  } else if ( !regex.test(value)) {
    callback(new Error("请输入字母、下划线或者数字"));
  } else {
    callback();
  }
};
